Kan Extensions for Program Optimisation Or: Art and Dan Explain an Old Trick

نویسنده

  • Ralf Hinze
چکیده

Many program optimisations involve transforming a program in direct style to an equivalent program in continuation-passing style. This paper investigates the theoretical underpinnings of this transformation in the categorical setting of monads. We argue that so-called absolute Kan Extensions underlie this program optimisation. It is known that every Kan extension gives rise to a monad, the codensity monad, and furthermore that every monad is isomorphic to a codensity monad. The end formula for Kan extensions then induces an implementation of the monad, which can be seen as the categorical counterpart of continuationpassing style. We show that several optimisations are instances of this scheme: Church representations and implementation of backtracking using success and failure continuations, among others. Furthermore, we develop the calculational properties of Kan extensions, powers and ends. In particular, we propose a two-dimensional notation based on string diagrams that aims to support effective reasoning with Kan extensions.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Geometry Preserving Kernel over Riemannian Manifolds

Abstract- Kernel trick and projection to tangent spaces are two choices for linearizing the data points lying on Riemannian manifolds. These approaches are used to provide the prerequisites for applying standard machine learning methods on Riemannian manifolds. Classical kernels implicitly project data to high dimensional feature space without considering the intrinsic geometry of data points. ...

متن کامل

Planning and Design of Urban Sustainable Riparian Park (Case Study: Kan River- Valley)

One of the most important natural factors and critical facilities in Tehran is presence of AlborzSlopes River-Valleys which have been considered as natural tourist places for citizens since a long time ago, especiallyin hot summers and play effective role in creating a balance between manmade and natural spaces. Importance ofthese river-valleys as ecological pathways is enhanced with the increa...

متن کامل

2 3 Ju n 19 99 Using Automata to obtain Regular Expressions for Induced Actions ∗

Presentations of Kan extensions of category actions provide a natural framework for expressing induced actions, and therefore a range of different combinatorial problems. Rewrite systems for Kan extensions have been defined and a variation on the Knuth-Bendix completion procedure can be used to complete them – when possible. Regular languages and automata are a useful way of expressing sets and...

متن کامل

Optimisation of Healthcare Contracts: Tensions Between Standardisation and Innovation; Comment on “Competition in Healthcare: Good, Bad or Ugly?”

An important determinant of health system performance is contracting. Providers often respond to financial incentives, despite the ethical underpinnings of medicine, and payers can craft contracts to influence performance. Yet contracting is highly imperfect in both single-payer and multi-payer health systems. Arguably, in a competitive, multi-payer environment, contractual innovation may occur...

متن کامل

Optimizing the Static and Dynamic Scheduling problem of Automated Guided Vehicles in Container Terminals

The Minimum Cost Flow (MCF) problem is a well-known problem in the area of network optimisation. To tackle this problem, Network Simplex Algorithm (NSA) is the fastest solution method. NSA has three extensions, namely Network Simplex plus Algorithm (NSA+), Dynamic Network Simplex Algorithm (DNSA) and Dynamic Network Simplex plus Algorithm (DNSA+). The objectives of the research reported in this...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2012